// $codepro.audit.disable numericLiterals, packagePrefixNamingConvention
/**
 * uses view package
 */
package javamonsters.view;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.FontFormatException;

import javax.swing.JTabbedPane;
import java.awt.GridLayout;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.io.File;
import java.io.IOException;

import javax.swing.ButtonGroup;
import javax.swing.JFormattedTextField;
import javax.swing.JButton;
import javax.swing.JRadioButton;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.Color;


/**
 * ConfigView is the view for the configuration screen
 * 
 * @author elahurd3
 * @version 1.0
 */
public class ConfigView extends JPanel implements View {
	
	
	/**
	 * JTextField for name
	 */
	private final JTextField textField;
	
	/**
	 * JButton for going back to the main menu
	 */
	private final JButton backButton;
	
	/**
	 * Dimensions of the window
	 */
	private Dimension currSize;
	
	/**
	 * JButton for starting the game
	 */
	private final JButton startButton;
	
	/**
	 * JSpinners for changing stats
	 */
	private final JSpinner fighterSpinner, engineerSpinner, pilotSpinner, traderSpinner;
	
	/**
	 * Radio buttons for handling difficulty
	 */
	private final JRadioButton radioEasy, radioNormal, radioHard;
	
	/**
	 * Custom fonts for the game
	 */
	private final Font topPanelTagFont, radioFont, descriptionFont, tabFont, buttonFont;
	
	/**
	 * Constructor for ConfigView, sets up the screen
	 * 
	 * @throws FontFormatException handle font exception
	 * @throws IOException handle IO exception
	 */
	public ConfigView() throws FontFormatException, IOException {
		super.setBackground(Color.BLACK);
		
		final File fontFile = new File("Fonts/Compass.ttf");
		final Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile);
		final float topPanelTagFontSize = 14f;
		topPanelTagFont = font.deriveFont(topPanelTagFontSize);
		final float radioFontSize = 12f;
		radioFont = font.deriveFont(radioFontSize);
		final float descriptionFontSize = 11f;
		descriptionFont = font.deriveFont(descriptionFontSize);
		final float tabFontSize = 9f;
		tabFont = font.deriveFont(tabFontSize);
		final float buttonFontSize = 20f;
		buttonFont = font.deriveFont(buttonFontSize);
		
		setLayout(new GridLayout(3, 3, 0, 0));
		
		super.setPreferredSize(new Dimension(700, 380));
		
		final JPanel topPanel = new JPanel();
		topPanel.setBackground(Color.BLACK);
		super.add(topPanel);
		final GridBagLayout gbl_topPanel = new GridBagLayout();
		gbl_topPanel.columnWidths = new int[]{204, 68, 30, 30, 30, 30, 80, 0};
		gbl_topPanel.rowHeights = new int[]{30, 27, 33, 0};
		gbl_topPanel.columnWeights = new double[]{
				0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gbl_topPanel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		topPanel.setLayout(gbl_topPanel);
		
		//"Enter Your Name:" Label
		final JLabel nameTagLabel = new JLabel("Enter Your Name: ");
		nameTagLabel.setForeground(Color.WHITE);
		nameTagLabel.setFont(topPanelTagFont);
		nameTagLabel.setHorizontalAlignment(SwingConstants.CENTER);
		final GridBagConstraints gbc_nameTagLabel = new GridBagConstraints();
		gbc_nameTagLabel.fill = GridBagConstraints.HORIZONTAL;
		gbc_nameTagLabel.insets = new Insets(0, 0, 5, 5);
		gbc_nameTagLabel.gridx = 0;
		gbc_nameTagLabel.gridy = 1;
		topPanel.add(nameTagLabel, gbc_nameTagLabel);
		
		//Player name input text field
		textField = new JTextField();
		textField.setFont(topPanelTagFont);
		final GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.anchor = GridBagConstraints.NORTH;
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.insets = new Insets(0, 0, 5, 5);
		gbc_textField.gridwidth = 4;
		gbc_textField.gridx = 2;
		gbc_textField.gridy = 1;
		topPanel.add(textField, gbc_textField);
		textField.setColumns(10);
		
		//"Select Difficulty" label
		final JLabel difficultyTagLabel = new JLabel("Select Difficulty: ");
		difficultyTagLabel.setForeground(Color.WHITE);
		difficultyTagLabel.setFont(topPanelTagFont);
		final GridBagConstraints gbc_difficultyTagLabel = new GridBagConstraints();
		gbc_difficultyTagLabel.insets = new Insets(0, 0, 0, 5);
		gbc_difficultyTagLabel.gridx = 0;
		gbc_difficultyTagLabel.gridy = 2;
		topPanel.add(difficultyTagLabel, gbc_difficultyTagLabel);
		
		radioEasy = new JRadioButton("Easy");
		radioEasy.setForeground(Color.WHITE);
		radioEasy.setBackground(Color.BLACK);
		radioEasy.setFont(radioFont);
		final GridBagConstraints gbc_radioEasy = new GridBagConstraints();
		gbc_radioEasy.anchor = GridBagConstraints.SOUTHWEST;
		gbc_radioEasy.insets = new Insets(0, 0, 0, 5);
		gbc_radioEasy.gridx = 2;
		gbc_radioEasy.gridy = 2;
		topPanel.add(radioEasy, gbc_radioEasy);
		
		////////////////////////////////////////////////
		
		//Difficulty radio buttons
		radioNormal = new JRadioButton("Normal");
		radioNormal.setBackground(Color.BLACK);
		radioNormal.setForeground(Color.WHITE);
		radioNormal.setFont(radioFont);
		final GridBagConstraints gbc_radioNormal = new GridBagConstraints();
		gbc_radioNormal.anchor = GridBagConstraints.SOUTH;
		gbc_radioNormal.fill = GridBagConstraints.HORIZONTAL;
		gbc_radioNormal.insets = new Insets(0, 0, 0, 5);
		gbc_radioNormal.gridx = 3;
		gbc_radioNormal.gridy = 2;
		topPanel.add(radioNormal, gbc_radioNormal);
		
		radioHard = new JRadioButton("Hard");
		radioHard.setForeground(Color.WHITE);
		radioHard.setBackground(Color.BLACK);
		radioHard.setFont(radioFont);
		final GridBagConstraints gbc_radioHard = new GridBagConstraints();
		gbc_radioHard.insets = new Insets(0, 0, 0, 5);
		gbc_radioHard.anchor = GridBagConstraints.SOUTHWEST;
		gbc_radioHard.gridx = 4;
		gbc_radioHard.gridy = 2;
		topPanel.add(radioHard, gbc_radioHard);
		
		final ButtonGroup radioGroup = new ButtonGroup();
		radioGroup.add(radioEasy);
		radioGroup.add(radioNormal);
		radioGroup.add(radioHard);
		/////////////////////////////////////////////////
		
		//text color is black when it's selected and white when it's not for better readability
		final JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP) {  
			public Color getForegroundAt(int index){  
		          if(getSelectedIndex() == index) return Color.BLACK;  
		          	return Color.WHITE;  
		      }  
		};  
		tabbedPane.setForeground(Color.WHITE);
		tabbedPane.setBackground(Color.BLACK);
		tabbedPane.setFont(tabFont);
		super.add(tabbedPane);
		//Fighter description panel, text, and skill spinner
		final JPanel fighterPanel = new JPanel();
		fighterPanel.setBackground(Color.BLACK);
		tabbedPane.addTab("Fighter", null, fighterPanel, null);
		GridBagLayout gbl_fighterPanel = new GridBagLayout();
		gbl_fighterPanel.columnWidths = new int[]{413, 222, 0};
		gbl_fighterPanel.rowHeights = new int[]{72, 0};
		gbl_fighterPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_fighterPanel.rowWeights = new double[]{0.0, Double.MIN_VALUE};
		fighterPanel.setLayout(gbl_fighterPanel);
		
		JPanel leftFighterPanel = new JPanel();
		leftFighterPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_leftFighterPanel = new GridBagConstraints();
		gbc_leftFighterPanel.fill = GridBagConstraints.BOTH;
		gbc_leftFighterPanel.insets = new Insets(0, 0, 0, 5);
		gbc_leftFighterPanel.gridx = 0;
		gbc_leftFighterPanel.gridy = 0;
		fighterPanel.add(leftFighterPanel, gbc_leftFighterPanel);
		GridBagLayout gbl_leftFighterPanel = new GridBagLayout();
		gbl_leftFighterPanel.columnWidths = new int[]{25, 0, 0};
		gbl_leftFighterPanel.rowHeights = new int[]{10, 0, 0, 0, 0};
		gbl_leftFighterPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_leftFighterPanel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		leftFighterPanel.setLayout(gbl_leftFighterPanel);
		
		final JLabel fighterLabel1 = new JLabel("The fighter skill " +
				"determines how well you handle your weapons,");
		GridBagConstraints gbc_fighterLabel1 = new GridBagConstraints();
		gbc_fighterLabel1.anchor = GridBagConstraints.WEST;
		gbc_fighterLabel1.insets = new Insets(0, 0, 5, 0);
		gbc_fighterLabel1.gridx = 1;
		gbc_fighterLabel1.gridy = 1;
		leftFighterPanel.add(fighterLabel1, gbc_fighterLabel1);
		fighterLabel1.setForeground(Color.WHITE);
		fighterLabel1.setFont(descriptionFont);
		
		final JLabel fighterLabel2 = new JLabel("in particular, " +
				"how easy it is for you hit another ship.");
		GridBagConstraints gbc_fighterLabel2 = new GridBagConstraints();
		gbc_fighterLabel2.anchor = GridBagConstraints.WEST;
		gbc_fighterLabel2.insets = new Insets(0, 0, 5, 0);
		gbc_fighterLabel2.gridx = 1;
		gbc_fighterLabel2.gridy = 2;
		leftFighterPanel.add(fighterLabel2, gbc_fighterLabel2);
		fighterLabel2.setForeground(Color.WHITE);
		fighterLabel2.setFont(descriptionFont);
		
		final JLabel fighterLabel3 = new JLabel("A targeting system " +
				"will enhance your fighting capabilities.");
		GridBagConstraints gbc_fighterLabel3 = new GridBagConstraints();
		gbc_fighterLabel3.anchor = GridBagConstraints.WEST;
		gbc_fighterLabel3.gridx = 1;
		gbc_fighterLabel3.gridy = 3;
		leftFighterPanel.add(fighterLabel3, gbc_fighterLabel3);
		fighterLabel3.setForeground(Color.WHITE);
		fighterLabel3.setFont(descriptionFont);
		
		JPanel rightFighterPanel = new JPanel();
		rightFighterPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_rightFighterPanel = new GridBagConstraints();
		gbc_rightFighterPanel.anchor = GridBagConstraints.WEST;
		gbc_rightFighterPanel.fill = GridBagConstraints.VERTICAL;
		gbc_rightFighterPanel.gridx = 1;
		gbc_rightFighterPanel.gridy = 0;
		fighterPanel.add(rightFighterPanel, gbc_rightFighterPanel);
		GridBagLayout gbl_rightFighterPanel = new GridBagLayout();
		gbl_rightFighterPanel.columnWidths = new int[] {43, 126};
		gbl_rightFighterPanel.rowHeights = new int[]{38, 0, 0, 0};
		gbl_rightFighterPanel.columnWeights = new double[]{0.0, 0.0};
		gbl_rightFighterPanel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		rightFighterPanel.setLayout(gbl_rightFighterPanel);
		
		fighterSpinner = new JSpinner();
		((JSpinner.DefaultEditor) fighterSpinner.getEditor()).getTextField().setEditable(false);
		GridBagConstraints gbc_fighterSpinner = new GridBagConstraints();
		gbc_fighterSpinner.insets = new Insets(0, 0, 5, 0);
		gbc_fighterSpinner.gridx = 1;
		gbc_fighterSpinner.gridy = 1;
		rightFighterPanel.add(fighterSpinner, gbc_fighterSpinner);
		fighterSpinner.setFont(new Font("Times New Roman", Font.PLAIN, 12));
		fighterSpinner.setModel(new SpinnerNumberModel(0, 0, 16, 1));
		//disables editing text directly in JSpinner
		final JFormattedTextField tf = ((JSpinner.DefaultEditor)
				fighterSpinner.getEditor()).getTextField();
		tf.setEditable(false);
		/////////////////////////////////////////////////////
		
		//Engineer description panel, text, and skill spinner
		final JPanel engineerPanel = new JPanel();
		engineerPanel.setBackground(Color.BLACK);
		tabbedPane.addTab("Engineer", null, engineerPanel, null);
		GridBagLayout gbl_engineerPanel = new GridBagLayout();
		gbl_engineerPanel.columnWidths = new int[]{451, 222, 0};
		gbl_engineerPanel.rowHeights = new int[]{72, 0};
		gbl_engineerPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_engineerPanel.rowWeights = new double[]{0.0, Double.MIN_VALUE};
		engineerPanel.setLayout(gbl_engineerPanel);
		
		JPanel leftEngineerPanel = new JPanel();
		leftEngineerPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_leftEngineerPanel = new GridBagConstraints();
		gbc_leftEngineerPanel.fill = GridBagConstraints.BOTH;
		gbc_leftEngineerPanel.insets = new Insets(0, 0, 0, 5);
		gbc_leftEngineerPanel.gridx = 0;
		gbc_leftEngineerPanel.gridy = 0;
		engineerPanel.add(leftEngineerPanel, gbc_leftEngineerPanel);
		GridBagLayout gbl_leftEngineerPanel = new GridBagLayout();
		gbl_leftEngineerPanel.columnWidths = new int[]{25, 334, 0};
		gbl_leftEngineerPanel.rowHeights = new int[]{12, 10, 10, 10, 0};
		gbl_leftEngineerPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_leftEngineerPanel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		leftEngineerPanel.setLayout(gbl_leftEngineerPanel);
		
		final JLabel engineerLabel1 = new JLabel("The engineer skill" +
				" determines how well you keep your ship in shape.");
		GridBagConstraints gbc_engineerLabel1 = new GridBagConstraints();
		gbc_engineerLabel1.anchor = GridBagConstraints.NORTHWEST;
		gbc_engineerLabel1.insets = new Insets(0, 0, 5, 0);
		gbc_engineerLabel1.gridx = 1;
		gbc_engineerLabel1.gridy = 0;
		leftEngineerPanel.add(engineerLabel1, gbc_engineerLabel1);
		engineerLabel1.setForeground(Color.WHITE);
		engineerLabel1.setFont(descriptionFont);
		
		final JLabel engineerLabel2 = new JLabel("A good engineer may" +
				" keep your hull and shields intact during a fight,");
		GridBagConstraints gbc_engineerLabel2 = new GridBagConstraints();
		gbc_engineerLabel2.anchor = GridBagConstraints.NORTHWEST;
		gbc_engineerLabel2.insets = new Insets(0, 0, 5, 0);
		gbc_engineerLabel2.gridx = 1;
		gbc_engineerLabel2.gridy = 1;
		leftEngineerPanel.add(engineerLabel2, gbc_engineerLabel2);
		engineerLabel2.setForeground(Color.WHITE);
		engineerLabel2.setFont(descriptionFont);
		
		final JLabel engineerLabel3 = new JLabel("will repair them" +
				" quicker while travelling, and may even enhance your .");
		GridBagConstraints gbc_engineerLabel3 = new GridBagConstraints();
		gbc_engineerLabel3.anchor = GridBagConstraints.NORTHWEST;
		gbc_engineerLabel3.insets = new Insets(0, 0, 5, 0);
		gbc_engineerLabel3.gridx = 1;
		gbc_engineerLabel3.gridy = 2;
		leftEngineerPanel.add(engineerLabel3, gbc_engineerLabel3);
		engineerLabel3.setForeground(Color.WHITE);
		engineerLabel3.setFont(descriptionFont);
		
		final JLabel engineerLabel4 = new JLabel(
				"weaponry a bit so it does more damage.");
		GridBagConstraints gbc_engineerLabel4 = new GridBagConstraints();
		gbc_engineerLabel4.anchor = GridBagConstraints.NORTHWEST;
		gbc_engineerLabel4.gridx = 1;
		gbc_engineerLabel4.gridy = 3;
		leftEngineerPanel.add(engineerLabel4, gbc_engineerLabel4);
		engineerLabel4.setForeground(Color.WHITE);
		engineerLabel4.setFont(descriptionFont);
		
		JPanel rightEngineerPanel = new JPanel();
		rightEngineerPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_rightEngineerPanel = new GridBagConstraints();
		gbc_rightEngineerPanel.fill = GridBagConstraints.BOTH;
		gbc_rightEngineerPanel.gridx = 1;
		gbc_rightEngineerPanel.gridy = 0;
		engineerPanel.add(rightEngineerPanel, gbc_rightEngineerPanel);
		GridBagLayout gbl_rightEngineerPanel = new GridBagLayout();
		gbl_rightEngineerPanel.columnWidths = new int[]{49, 41, 0};
		gbl_rightEngineerPanel.rowHeights = new int[]{38, 0, 0};
		gbl_rightEngineerPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_rightEngineerPanel.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		rightEngineerPanel.setLayout(gbl_rightEngineerPanel);
		
		engineerSpinner = new JSpinner();
		((JSpinner.DefaultEditor) engineerSpinner.getEditor()).getTextField().setEditable(false);
		GridBagConstraints gbc_engineerSpinner = new GridBagConstraints();
		gbc_engineerSpinner.anchor = GridBagConstraints.NORTHWEST;
		gbc_engineerSpinner.gridx = 1;
		gbc_engineerSpinner.gridy = 1;
		rightEngineerPanel.add(engineerSpinner, gbc_engineerSpinner);
		engineerSpinner.setFont(new Font("Times New Roman", Font.PLAIN, 12));
		engineerSpinner.setModel(new SpinnerNumberModel(0, 0, 16, 1));
		//disables editing text directly in JSpinner
		final JFormattedTextField tf2 = ((JSpinner.DefaultEditor)
				engineerSpinner.getEditor()).getTextField();
		tf2.setEditable(false);
		//Pilot description panel, text, and skill spinner
		final JPanel pilotPanel = new JPanel();
		pilotPanel.setBackground(Color.BLACK);
		tabbedPane.addTab("Pilot", null, pilotPanel, null);
		GridBagLayout gbl_pilotPanel = new GridBagLayout();
		gbl_pilotPanel.columnWidths = new int[]{504, 222, 0};
		gbl_pilotPanel.rowHeights = new int[]{72, 0};
		gbl_pilotPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_pilotPanel.rowWeights = new double[]{0.0, Double.MIN_VALUE};
		pilotPanel.setLayout(gbl_pilotPanel);
		
		JPanel leftPilotPanel = new JPanel();
		leftPilotPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_leftPilotPanel = new GridBagConstraints();
		gbc_leftPilotPanel.fill = GridBagConstraints.BOTH;
		gbc_leftPilotPanel.insets = new Insets(0, 0, 0, 5);
		gbc_leftPilotPanel.gridx = 0;
		gbc_leftPilotPanel.gridy = 0;
		pilotPanel.add(leftPilotPanel, gbc_leftPilotPanel);
		GridBagLayout gbl_leftPilotPanel = new GridBagLayout();
		gbl_leftPilotPanel.columnWidths = new int[]{25, 258, 0};
		gbl_leftPilotPanel.rowHeights = new int[]{14, 14, 20, 10, 0};
		gbl_leftPilotPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_leftPilotPanel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		leftPilotPanel.setLayout(gbl_leftPilotPanel);
		
		final JLabel pilotLabel1 = new JLabel("The pilot skill " +
				"determines how well you pilot your ship. ");
		GridBagConstraints gbc_pilotLabel1 = new GridBagConstraints();
		gbc_pilotLabel1.anchor = GridBagConstraints.NORTHWEST;
		gbc_pilotLabel1.insets = new Insets(0, 0, 5, 0);
		gbc_pilotLabel1.gridx = 1;
		gbc_pilotLabel1.gridy = 0;
		leftPilotPanel.add(pilotLabel1, gbc_pilotLabel1);
		pilotLabel1.setForeground(Color.WHITE);
		pilotLabel1.setFont(descriptionFont);
		
		final JLabel pilotLabel2 = new JLabel("A high piloting skill" +
				" will enable you to flee from attacks easily,");
		GridBagConstraints gbc_pilotLabel2 = new GridBagConstraints();
		gbc_pilotLabel2.anchor = GridBagConstraints.NORTHWEST;
		gbc_pilotLabel2.insets = new Insets(0, 0, 5, 0);
		gbc_pilotLabel2.gridx = 1;
		gbc_pilotLabel2.gridy = 1;
		leftPilotPanel.add(pilotLabel2, gbc_pilotLabel2);
		pilotLabel2.setForeground(Color.WHITE);
		pilotLabel2.setFont(descriptionFont);
		
		final JLabel pilotLabel3 = new JLabel("dodge attacks, and" +
				" to stay on the tail of fleeing ships");
		GridBagConstraints gbc_pilotLabel3 = new GridBagConstraints();
		gbc_pilotLabel3.anchor = GridBagConstraints.NORTHWEST;
		gbc_pilotLabel3.insets = new Insets(0, 0, 5, 0);
		gbc_pilotLabel3.gridx = 1;
		gbc_pilotLabel3.gridy = 2;
		leftPilotPanel.add(pilotLabel3, gbc_pilotLabel3);
		pilotLabel3.setForeground(Color.WHITE);
		pilotLabel3.setFont(descriptionFont);
		
		final JLabel pilotLabel4 = new JLabel("if you want to keep attacking them. ");
		GridBagConstraints gbc_pilotLabel4 = new GridBagConstraints();
		gbc_pilotLabel4.anchor = GridBagConstraints.NORTHWEST;
		gbc_pilotLabel4.gridx = 1;
		gbc_pilotLabel4.gridy = 3;
		leftPilotPanel.add(pilotLabel4, gbc_pilotLabel4);
		pilotLabel4.setForeground(Color.WHITE);
		pilotLabel4.setFont(descriptionFont);
		
		JPanel rightPilotPanel = new JPanel();
		rightPilotPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_rightPilotPanel = new GridBagConstraints();
		gbc_rightPilotPanel.fill = GridBagConstraints.BOTH;
		gbc_rightPilotPanel.gridx = 1;
		gbc_rightPilotPanel.gridy = 0;
		pilotPanel.add(rightPilotPanel, gbc_rightPilotPanel);
		GridBagLayout gbl_rightPilotPanel = new GridBagLayout();
		gbl_rightPilotPanel.columnWidths = new int[]{19, 41, 0};
		gbl_rightPilotPanel.rowHeights = new int[]{38, 0, 0};
		gbl_rightPilotPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_rightPilotPanel.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		rightPilotPanel.setLayout(gbl_rightPilotPanel);
		
		pilotSpinner = new JSpinner();
		((JSpinner.DefaultEditor) pilotSpinner.getEditor()).getTextField().setEditable(false);
		GridBagConstraints gbc_pilotSpinner = new GridBagConstraints();
		gbc_pilotSpinner.anchor = GridBagConstraints.NORTHWEST;
		gbc_pilotSpinner.gridx = 1;
		gbc_pilotSpinner.gridy = 1;
		rightPilotPanel.add(pilotSpinner, gbc_pilotSpinner);
		pilotSpinner.setFont(new Font("Times New Roman", Font.PLAIN, 12));
		pilotSpinner.setModel(new SpinnerNumberModel(0, 0, 16, 1));
		//disables editing text directly in JSpinner
		final JFormattedTextField tf3 = ((JSpinner.DefaultEditor)
				pilotSpinner.getEditor()).getTextField();
		tf3.setEditable(false);
		//Trader description panel, text, and skill spinner
		final JPanel traderPanel = new JPanel();
		traderPanel.setBackground(Color.BLACK);
		tabbedPane.addTab("Trader", null, traderPanel, null);
		GridBagLayout gbl_traderPanel = new GridBagLayout();
		gbl_traderPanel.columnWidths = new int[] {504, 222};
		gbl_traderPanel.rowHeights = new int[]{0, 41, 0};
		gbl_traderPanel.columnWeights = new double[]{0.0, 0.0};
		gbl_traderPanel.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		traderPanel.setLayout(gbl_traderPanel);
		
		JPanel leftTraderPanel = new JPanel();
		leftTraderPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_leftTraderPanel = new GridBagConstraints();
		gbc_leftTraderPanel.fill = GridBagConstraints.BOTH;
		gbc_leftTraderPanel.insets = new Insets(0, 0, 0, 5);
		gbc_leftTraderPanel.gridx = 0;
		gbc_leftTraderPanel.gridy = 1;
		traderPanel.add(leftTraderPanel, gbc_leftTraderPanel);
		GridBagLayout gbl_leftTraderPanel = new GridBagLayout();
		gbl_leftTraderPanel.columnWidths = new int[]{25, 258, 0};
		gbl_leftTraderPanel.rowHeights = new int[]{22, 20, 20, 0};
		gbl_leftTraderPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_leftTraderPanel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		leftTraderPanel.setLayout(gbl_leftTraderPanel);
		
		final JLabel traderLabel1 = new JLabel("The trader skill" +
				" determines what prices you must pay for trade goods, ");
		GridBagConstraints gbc_traderLabel1 = new GridBagConstraints();
		gbc_traderLabel1.anchor = GridBagConstraints.WEST;
		gbc_traderLabel1.fill = GridBagConstraints.VERTICAL;
		gbc_traderLabel1.insets = new Insets(0, 0, 5, 0);
		gbc_traderLabel1.gridx = 1;
		gbc_traderLabel1.gridy = 1;
		leftTraderPanel.add(traderLabel1, gbc_traderLabel1);
		traderLabel1.setForeground(Color.WHITE);
		traderLabel1.setFont(descriptionFont);
		
		final JLabel traderLabel2 = new JLabel("ships, and equipment. A good trader can reduce prices up to 10%.");
		GridBagConstraints gbc_traderLabel2 = new GridBagConstraints();
		gbc_traderLabel2.anchor = GridBagConstraints.WEST;
		gbc_traderLabel2.fill = GridBagConstraints.VERTICAL;
		gbc_traderLabel2.gridx = 1;
		gbc_traderLabel2.gridy = 2;
		leftTraderPanel.add(traderLabel2, gbc_traderLabel2);
		traderLabel2.setForeground(Color.WHITE);
		traderLabel2.setFont(descriptionFont);
		
		JPanel rightTraderPanel = new JPanel();
		rightTraderPanel.setBackground(Color.BLACK);
		GridBagConstraints gbc_rightTraderPanel = new GridBagConstraints();
		gbc_rightTraderPanel.fill = GridBagConstraints.BOTH;
		gbc_rightTraderPanel.gridx = 1;
		gbc_rightTraderPanel.gridy = 1;
		traderPanel.add(rightTraderPanel, gbc_rightTraderPanel);
		GridBagLayout gbl_rightTraderPanel = new GridBagLayout();
		gbl_rightTraderPanel.columnWidths = new int[]{19, 41, 0, 0};
		gbl_rightTraderPanel.rowHeights = new int[]{38, 20, 0};
		gbl_rightTraderPanel.columnWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		gbl_rightTraderPanel.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		rightTraderPanel.setLayout(gbl_rightTraderPanel);
		
		traderSpinner = new JSpinner();
		((JSpinner.DefaultEditor) traderSpinner.getEditor()).getTextField().setEditable(false);
		GridBagConstraints gbc_traderSpinner = new GridBagConstraints();
		gbc_traderSpinner.insets = new Insets(0, 0, 0, 5);
		gbc_traderSpinner.anchor = GridBagConstraints.NORTHWEST;
		gbc_traderSpinner.gridx = 1;
		gbc_traderSpinner.gridy = 1;
		rightTraderPanel.add(traderSpinner, gbc_traderSpinner);
		traderSpinner.setFont(new Font("Times New Roman", Font.PLAIN, 12));
		traderSpinner.setModel(new SpinnerNumberModel(0, 0, 16, 1));
		//disables editing text directly in JSpinner
		final JFormattedTextField tf4 = ((JSpinner.DefaultEditor)
				traderSpinner.getEditor()).getTextField();
		tf4.setEditable(false);
		//Start button and Back button
		final JPanel bottomPanel = new JPanel();
		bottomPanel.setBackground(Color.BLACK);
		bottomPanel.setForeground(Color.WHITE);
		super.add(bottomPanel);
		final GridBagLayout gbl_bottomPanel = new GridBagLayout();
		gbl_bottomPanel.columnWidths = new int[]{237, 170, 0};
		gbl_bottomPanel.rowHeights = new int[]{21, 40, 40, 17, 0};
		gbl_bottomPanel.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		gbl_bottomPanel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		bottomPanel.setLayout(gbl_bottomPanel);
		
		startButton = new JButton("Start Game");
		startButton.setFont(buttonFont);
		final GridBagConstraints gbc_startButton = new GridBagConstraints();
		gbc_startButton.insets = new Insets(0, 0, 5, 0);
		gbc_startButton.gridx = 1;
		gbc_startButton.gridy = 1;
		bottomPanel.add(startButton, gbc_startButton);
		startButton.setEnabled(false);
		
		backButton = new JButton("Back");
		backButton.setFont(buttonFont);
		final GridBagConstraints gbc_backButton = new GridBagConstraints();
		gbc_backButton.insets = new Insets(0, 0, 5, 0);
		gbc_backButton.gridx = 1;
		gbc_backButton.gridy = 2;
		bottomPanel.add(backButton, gbc_backButton);
	
	}
	
	//Getters
	/**
	 * getter for start button
	 * @return JButton that starts the game
	 */
	public JButton getStartButton() {
		return startButton;
	}
	
	/**
	 * getter for start button back button
	 * @return JButton that takes player back to title screen
	 */
	public JButton getBackButton() {
		return backButton;
	}
	
	/**
	 * getter for current size
	 * @return Dimension
	 */
	public Dimension getCurrSize() {
		return currSize;
	}
	
	/**
	 * getter for fighter spinner
	 * @return JSpinner that allows player to select the points for Fighter stat
	 */
	public JSpinner getFighterSpinner() {
		return fighterSpinner;
	}
	
	/**
	 * getter for engineer spinner
	 * @return JSpinner that allows player to select the points for Engineer stat
	 */
	public JSpinner getEngineerSpinner() {
		return engineerSpinner;
	}
	
	/**
	 * getter for pilot spinner
	 * @return JSpinner that allows player to select the points for Pilot stat
	 */
	public JSpinner getPilotSpinner() {
		return pilotSpinner;
	}
	
	/**
	 * getter for trader spinner
	 * @return JSpinner that allows player to select the points for Trader stat
	 */
	public JSpinner getTraderSpinner() {
		return traderSpinner;
	}
	
	/**
	 * getter for text field
	 * @return textField 
	 */
	public JTextField getTextField() {
		return textField;
	}
	
	/**
	 * getter for radio easy
	 * @return JRadioButton for easy difficulty
	 */
	public JRadioButton getRadioEasy() {
		return radioEasy;
	}
	
	/**
	 * getter for radio normal
	 * @return JRadioButton for normal difficulty
	 */
	public JRadioButton getRadioNormal() {
		return radioNormal;
	}
	
	/**
	 * getter for radio hard
	 * @return JRadioButton for hard difficulty
	 */
	public JRadioButton getRadioHard() {
		return radioHard;
	}

	/**
	 * @param currSize the currSize to set
	 */
	public void setCurrSize(Dimension currSize) {
		this.currSize = currSize;
	}

	
	
	
}
